
var t = n = 0, count;
var t1 = n1 = 0, count1;

$(document).ready(function(){


	$('.hover').hover(
			function () {
				 $(this).removeClass().addClass("hover0");
			  },
			  function () {
				  $(this).removeClass().addClass("hover");
			  }
			
			);
	
	$('#page-wrap li:first-child').css("border-bottom","5px solid #1A5C14");
	$('#page-wrap div:first-child').css("display","block");
	
	$('#page-wrap li.button').hover(
			function () {
				$clicked = $(this);
				$clicked.animate({
					opacity: 1,
					borderWidth: 5
				}, 100 );
				var idToLoad = $clicked.attr("id").split('-');
				$("#content").find("#"+idToLoad[0]).css('display','block');
				
				$("#content").find("#"+idToLoad[0]).siblings(".home").css('display','none');
				$clicked.siblings(".button").animate({
					opacity: 0.7,
					borderWidth: 1
				}, 100 );
			  },
			  function () {
				 
					
			  }
			
			);
	
	count=$("#banner_list a").length;
	$("#banner_list a:not(:first-child)").hide();
	$("#banner_info").html($("#banner_list a:first-child").find("img").attr

('alt'));
	$("#banner_info").click(function(){window.open($("#banner_list a:first-child").attr('href'), "_blank");});
	$("#banner li").click(function() {
		var i = $(this).text() - 1;//获取Li元素内的值，即1，2，3，4
		n = i;
		if (i >= count) return;
		$("#banner_info").html($("#banner_list a").eq(i).find("img").attr

('alt'));
		$("#banner_info").unbind().click(function(){window.open($("#banner_list a").eq(i).attr('href'), "_blank");});
		$("#banner_list a").filter(":visible").fadeOut(500).parent().children

().eq(i).fadeIn(1000);
		document.getElementById("banner").style.background="";
		$(this).toggleClass("on");
		$(this).siblings().removeAttr("class");
	});
	t = setInterval("showAuto()", 3000);
	$("#banner").hover(function(){clearInterval(t);}, function(){t = setInterval

		("showAuto()", 3000);
	});

	count1=$("#activity_list a").length;
	$("#activity_list a:not(:first-child)").hide();
	$("#activity_info").html($("#activity_list a:first-child").find("img").attr

('alt'));
	$("#activity_info").click(function(){window.open($("#activity_list a:first-child").attr('href'), "_blank");});
	$("#activity li").click(function() {
		var i = $(this).text() - 1;//获取Li元素内的值，即1，2，3，4
		n1 = i;
		if (i >= count) return;
		$("#activity_info").html($("#activity_list a").eq(i).find("img").attr

('alt'));
		$("#activity_info").unbind().click(function(){window.open($("#activity_list a").eq(i).attr('href'), "_blank");});
		$("#activity_list a").filter(":visible").fadeOut(500).parent().children

().eq(i).fadeIn(1000);
		document.getElementById("activity").style.background="";
		$(this).toggleClass("on");
		$(this).siblings().removeAttr("class");
	});
	t1 = setInterval("showAuto1()", 3000);
	$("#activity").hover(function(){clearInterval(t1);}, function(){t1 = setInterval

		("showAuto1()", 3000);
	});


});


function showAuto()
{
	n = n >=(count - 1) ? 0 : ++n;
	$("#banner li").eq(n).trigger('click');
}
function showAuto1()
{
	n1 = n1 >=(count1 - 1) ? 0 : ++n1;
	$("#activity li").eq(n).trigger('click');
}



